﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Chrysalis.Services;
using System.Diagnostics;
using System.Windows.Navigation;

namespace Chrysalis
{
    public abstract class ControllerBase
    {
        // *** Properties ***

        public PhoneApplicationPage Page { get; private set; }

        public object ViewModel { get; private set; }

        // *** Methods ***

        public void Initialize(PhoneApplicationPage page)
        {
            // Store the arguments

            Page = page;

            // Initialize the view model

            ViewModel = InitializeViewModel();
            Page.DataContext = ViewModel;
        }

        // *** Protected Methods ***

        protected virtual object InitializeViewModel()
        {
            return null;
        }
    }
}
